Launch arguments

  • Launch option to replace languages selected in the system.

    Allows to replace order of preferred languages which will be used by the application do display localized content.

    Argument:

    AppleLanguages

    Example:

    SystemLanguages([.English, .Polish])
    // or
    [.English, .Polish] as SystemLanguages
    

    Generated strings:

    -AppleLanguages ("en", "pl")
    
    See more

    Declaration

    Swift

    public struct SystemLanguages : LanguageLaunchArgument, LaunchArgumentWithMultipleValues
  • Launch option to replace locale selected in the system.

    Allows to replace users locale.

    Argument:

    AppleLocale

    Example:

    SystemLocale(localeIdentifier: "pl")
    SystemLocale(language: .Polish, country: .Poland)
    

    Generated strings:

    -AppleLocale "pl"
    -AppleLocale "pl_PL"
    
    See more

    Declaration

    Swift

    public struct SystemLocale : LocaleLaunchArgument, LaunchArgumentWithSingleValue
  • Launch option to enable debug options for CoreData.

    • sqlDebug: Enables SQLDebug logging with given verbosity level.
    • syntaxColoredLogging: Turns on SQL syntax coloring.
    • migrationDebug: Logs exceptions during data migrations.
    • concurrencyDebug: Enables extra assertions related to concurrency.
    • sqLiteDebugSynchronous: Controls behaviour of SQLite disk syncing.
    • sqLiteIntegrityCheck: Enables extra integrity checking.
    • threadingDebug: Enables assertions for Core Data’s multi-threading policy.

    Example:

    CoreDataOption.sqlDebug(verbosityLevel: .high)
    
    See more

    Declaration

    Swift

    public enum CoreDataOption
  • Launch option to enable debug settings for string localization.

    • doubleLocalizedStrings: Makes all localized strings twice as long.
    • showNonLocalizedStrings: Capitalizes all untranslated strings in the application.

    Example:

    LocalizedStrings.doubleLocalizedStrings
    
    See more

    Declaration

    Swift

    public enum LocalizedStrings : String
  • Any type that implements this protocol can be used to configure application with TestLauncher. Specifically it represents launch argument option so it requires to provide argument key. Type conforming to this protocol should override default implementation of launchArguments.

    Custom launch arguments can implement one of two additional protocols:

    For more info about launch arguments variables check: Xcode Help.

    See more

    Declaration

    Swift

    public protocol LaunchArgument : LaunchOption
  • Protocol that should be implemented by types representing launch argument that accepts single argument value.

    Example:

    enum Server: String, LaunchArgumentWithSingleValue, LaunchArgumentValue {
        case testing, production
    
        var key: String {
            return "Server"
        }
    }
    

    Usage:

    let app = XCUIApplication()
    TestLauncher(options: [
        Server.testing
    ]).configure(app).launch()
    

    Handling:

    let serverAddress = UserDefaults.standard.string(forKey: "Server")
    
    See more

    Declaration

    Swift

    public protocol LaunchArgumentWithSingleValue : LaunchArgument
  • Protocol that should be implemented by types representing launch argument that accepts collection of values.

    Example:

    struct MagicNumbers: LaunchArgumentWithMultipleValues {
        struct Number: LaunchArgumentValue {
            var value: String {
                return "\(number)"
            }
            let number: Int
        }
    
        let key = "MagicNumbers"
        let values: [Number]
        public init(_ values: [Number]) {
            self.values = values
        }
    }
    

    Usage:

    let app = XCUIApplication()
    TestLauncher(options: [
        MagicNumbers([.init(number: 5), .init(number: 7)])
    ]).configure(app).launch()
    

    Handling:

    let magicNumbers = UserDefaults.standard.stringArray(forKey: "MagicNumbers")
    
    See more

    Declaration

    Swift

    public protocol LaunchArgumentWithMultipleValues : LaunchArgument, ExpressibleByArrayLiteral
  • Represents single portion of data to be passed through launch argument.

    Objects implementing LaunchArgumentValue are used by the LaunchArgumentWithSingleValue and LaunchArgumentWithMultipleValues.

    AutoMate provides default implementation for RawRepresentable objects and Bool values (check BooleanLaunchArgumentValue).

    Example:

    enum Server: String, LaunchArgumentWithSingleValue, LaunchArgumentValue {
        case testing, production
    
        var key: String {
            return "Server"
        }
    }
    
    struct Number: LaunchArgumentValue {
        var value: String {
            return "\(number)"
        }
        let number: Int
    }
    
    See more

    Declaration

    Swift

    public protocol LaunchArgumentValue